
#
# WARNING WARNING WARNING
#
# This file is generated by generate_mozbuild.py (from
# https://github.com/mozilla/angle). Do not modify it without also modifying
# generate_mozbuild.py.
#
# WARNING WARNING WARNING
#
UNIFIED_SOURCES += [
    '../common/angleutils.cpp',
    '../common/debug.cpp',
    '../common/event_tracer.cpp',
    '../common/Float16ToFloat32.cpp',
    '../common/mathutil.cpp',
    '../common/MemoryBuffer.cpp',
    '../common/string_utils.cpp',
    '../common/tls.cpp',
    '../common/utilities.cpp',
    '../compiler/preprocessor/DiagnosticsBase.cpp',
    '../compiler/preprocessor/DirectiveHandlerBase.cpp',
    '../compiler/preprocessor/DirectiveParser.cpp',
    '../compiler/preprocessor/ExpressionParser.cpp',
    '../compiler/preprocessor/Input.cpp',
    '../compiler/preprocessor/Lexer.cpp',
    '../compiler/preprocessor/Macro.cpp',
    '../compiler/preprocessor/MacroExpander.cpp',
    '../compiler/preprocessor/Preprocessor.cpp',
    '../compiler/preprocessor/Token.cpp',
    '../compiler/preprocessor/Tokenizer.cpp',
    '../compiler/translator/AddDefaultReturnStatements.cpp',
    '../compiler/translator/ArrayReturnValueToOutParameter.cpp',
    '../compiler/translator/ASTMetadataHLSL.cpp',
    '../compiler/translator/blocklayout.cpp',
    '../compiler/translator/blocklayoutHLSL.cpp',
    '../compiler/translator/BuiltInFunctionEmulator.cpp',
    '../compiler/translator/BuiltInFunctionEmulatorGLSL.cpp',
    '../compiler/translator/BuiltInFunctionEmulatorHLSL.cpp',
    '../compiler/translator/Cache.cpp',
    '../compiler/translator/CallDAG.cpp',
    '../compiler/translator/CodeGen.cpp',
    '../compiler/translator/Compiler.cpp',
    '../compiler/translator/DeferGlobalInitializers.cpp',
    '../compiler/translator/depgraph/DependencyGraph.cpp',
    '../compiler/translator/depgraph/DependencyGraphBuilder.cpp',
    '../compiler/translator/depgraph/DependencyGraphOutput.cpp',
    '../compiler/translator/depgraph/DependencyGraphTraverse.cpp',
    '../compiler/translator/Diagnostics.cpp',
    '../compiler/translator/DirectiveHandler.cpp',
    '../compiler/translator/EmulatePrecision.cpp',
    '../compiler/translator/ExpandIntegerPowExpressions.cpp',
    '../compiler/translator/ExtensionGLSL.cpp',
    '../compiler/translator/FlagStd140Structs.cpp',
    '../compiler/translator/ForLoopUnroll.cpp',
    '../compiler/translator/InfoSink.cpp',
    '../compiler/translator/Initialize.cpp',
    '../compiler/translator/InitializeDll.cpp',
    '../compiler/translator/InitializeParseContext.cpp',
    '../compiler/translator/InitializeVariables.cpp',
    '../compiler/translator/Intermediate.cpp',
    '../compiler/translator/IntermNode.cpp',
    '../compiler/translator/IntermNodePatternMatcher.cpp',
    '../compiler/translator/intermOut.cpp',
    '../compiler/translator/IntermTraverse.cpp',
    '../compiler/translator/LoopInfo.cpp',
    '../compiler/translator/Operator.cpp',
    '../compiler/translator/OutputESSL.cpp',
    '../compiler/translator/OutputGLSL.cpp',
    '../compiler/translator/OutputGLSLBase.cpp',
    '../compiler/translator/OutputHLSL.cpp',
    '../compiler/translator/ParseContext.cpp',
    '../compiler/translator/PoolAlloc.cpp',
    '../compiler/translator/PruneEmptyDeclarations.cpp',
    '../compiler/translator/RecordConstantPrecision.cpp',
    '../compiler/translator/RegenerateStructNames.cpp',
    '../compiler/translator/RemoveDynamicIndexing.cpp',
    '../compiler/translator/RemovePow.cpp',
    '../compiler/translator/RemoveSwitchFallThrough.cpp',
    '../compiler/translator/RewriteDoWhile.cpp',
    '../compiler/translator/RewriteElseBlocks.cpp',
    '../compiler/translator/RewriteTexelFetchOffset.cpp',
    '../compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp',
    '../compiler/translator/SearchSymbol.cpp',
    '../compiler/translator/SeparateArrayInitialization.cpp',
    '../compiler/translator/SeparateDeclarations.cpp',
    '../compiler/translator/SeparateExpressionsReturningArrays.cpp',
    '../compiler/translator/ShaderLang.cpp',
    '../compiler/translator/ShaderVars.cpp',
    '../compiler/translator/SimplifyLoopConditions.cpp',
    '../compiler/translator/SplitSequenceOperator.cpp',
    '../compiler/translator/StructureHLSL.cpp',
    '../compiler/translator/SymbolTable.cpp',
    '../compiler/translator/TextureFunctionHLSL.cpp',
    '../compiler/translator/timing/RestrictFragmentShaderTiming.cpp',
    '../compiler/translator/timing/RestrictVertexShaderTiming.cpp',
    '../compiler/translator/TranslatorESSL.cpp',
    '../compiler/translator/TranslatorGLSL.cpp',
    '../compiler/translator/TranslatorHLSL.cpp',
    '../compiler/translator/Types.cpp',
    '../compiler/translator/UnfoldShortCircuitAST.cpp',
    '../compiler/translator/UnfoldShortCircuitToIf.cpp',
    '../compiler/translator/UniformHLSL.cpp',
    '../compiler/translator/util.cpp',
    '../compiler/translator/UtilsHLSL.cpp',
    '../compiler/translator/ValidateGlobalInitializer.cpp',
    '../compiler/translator/ValidateLimitations.cpp',
    '../compiler/translator/ValidateMaxParameters.cpp',
    '../compiler/translator/ValidateOutputs.cpp',
    '../compiler/translator/ValidateSwitch.cpp',
    '../compiler/translator/VariableInfo.cpp',
    '../compiler/translator/VariablePacker.cpp',
    '../compiler/translator/VersionGLSL.cpp',
    '../image_util/copyimage.cpp',
    '../image_util/imageformats.cpp',
    '../image_util/loadimage.cpp',
    '../image_util/loadimage_etc.cpp',
    '../third_party/compiler/ArrayBoundsClamper.cpp',
    '../third_party/murmurhash/MurmurHash3.cpp',
    '../third_party/systeminfo/SystemInfo.cpp',
    'angletypes.cpp',
    'AttributeMap.cpp',
    'Buffer.cpp',
    'Caps.cpp',
    'Compiler.cpp',
    'Config.cpp',
    'Context.cpp',
    'ContextState.cpp',
    'Debug.cpp',
    'Device.cpp',
    'Error.cpp',
    'Fence.cpp',
    'formatutils.cpp',
    'Framebuffer.cpp',
    'FramebufferAttachment.cpp',
    'HandleAllocator.cpp',
    'HandleRangeAllocator.cpp',
    'Image.cpp',
    'ImageIndex.cpp',
    'IndexRangeCache.cpp',
    'Path.cpp',
    'Platform.cpp',
    'Program.cpp',
    'Query.cpp',
    'queryconversions.cpp',
    'Renderbuffer.cpp',
    'renderer/ContextImpl.cpp',
    'renderer/d3d/BufferD3D.cpp',
    'renderer/d3d/CompilerD3D.cpp',
    'renderer/d3d/d3d9/Blit9.cpp',
    'renderer/d3d/d3d9/Buffer9.cpp',
    'renderer/d3d/d3d9/Context9.cpp',
    'renderer/d3d/d3d9/DebugAnnotator9.cpp',
    'renderer/d3d/d3d9/Fence9.cpp',
    'renderer/d3d/d3d9/formatutils9.cpp',
    'renderer/d3d/d3d9/Framebuffer9.cpp',
    'renderer/d3d/d3d9/Image9.cpp',
    'renderer/d3d/d3d9/IndexBuffer9.cpp',
    'renderer/d3d/d3d9/NativeWindow9.cpp',
    'renderer/d3d/d3d9/Query9.cpp',
    'renderer/d3d/d3d9/Renderer9.cpp',
    'renderer/d3d/d3d9/renderer9_utils.cpp',
    'renderer/d3d/d3d9/RenderTarget9.cpp',
    'renderer/d3d/d3d9/ShaderExecutable9.cpp',
    'renderer/d3d/d3d9/StateManager9.cpp',
    'renderer/d3d/d3d9/SwapChain9.cpp',
    'renderer/d3d/d3d9/TextureStorage9.cpp',
    'renderer/d3d/d3d9/VertexBuffer9.cpp',
    'renderer/d3d/d3d9/VertexDeclarationCache.cpp',
    'renderer/d3d/DeviceD3D.cpp',
    'renderer/d3d/DynamicHLSL.cpp',
    'renderer/d3d/EGLImageD3D.cpp',
    'renderer/d3d/FramebufferD3D.cpp',
    'renderer/d3d/ImageD3D.cpp',
    'renderer/d3d/IndexBuffer.cpp',
    'renderer/d3d/IndexDataManager.cpp',
    'renderer/d3d/NativeWindowD3D.cpp',
    'renderer/d3d/ProgramD3D.cpp',
    'renderer/d3d/RenderbufferD3D.cpp',
    'renderer/d3d/RendererD3D.cpp',
    'renderer/d3d/RenderTargetD3D.cpp',
    'renderer/d3d/ShaderD3D.cpp',
    'renderer/d3d/ShaderExecutableD3D.cpp',
    'renderer/d3d/SurfaceD3D.cpp',
    'renderer/d3d/TextureD3D.cpp',
    'renderer/d3d/VaryingPacking.cpp',
    'renderer/d3d/VertexBuffer.cpp',
    'renderer/d3d/VertexDataManager.cpp',
    'renderer/DeviceImpl.cpp',
    'renderer/DisplayImpl.cpp',
    'renderer/Format.cpp',
    'renderer/Format_autogen.cpp',
    'renderer/gl/BlitGL.cpp',
    'renderer/gl/BufferGL.cpp',
    'renderer/gl/CompilerGL.cpp',
    'renderer/gl/ContextGL.cpp',
    'renderer/gl/DisplayGL.cpp',
    'renderer/gl/FenceNVGL.cpp',
    'renderer/gl/FenceSyncGL.cpp',
    'renderer/gl/formatutilsgl.cpp',
    'renderer/gl/FramebufferGL.cpp',
    'renderer/gl/FunctionsGL.cpp',
    'renderer/gl/PathGL.cpp',
    'renderer/gl/ProgramGL.cpp',
    'renderer/gl/QueryGL.cpp',
    'renderer/gl/RenderbufferGL.cpp',
    'renderer/gl/RendererGL.cpp',
    'renderer/gl/renderergl_utils.cpp',
    'renderer/gl/SamplerGL.cpp',
    'renderer/gl/ShaderGL.cpp',
    'renderer/gl/StateManagerGL.cpp',
    'renderer/gl/SurfaceGL.cpp',
    'renderer/gl/TextureGL.cpp',
    'renderer/gl/TransformFeedbackGL.cpp',
    'renderer/gl/VertexArrayGL.cpp',
    'renderer/gl/wgl/DisplayWGL.cpp',
    'renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp',
    'renderer/gl/wgl/FunctionsWGL.cpp',
    'renderer/gl/wgl/PbufferSurfaceWGL.cpp',
    'renderer/gl/wgl/wgl_utils.cpp',
    'renderer/gl/wgl/WindowSurfaceWGL.cpp',
    'renderer/load_functions_table_autogen.cpp',
    'renderer/renderer_utils.cpp',
    'renderer/SurfaceImpl.cpp',
    'renderer/TextureImpl.cpp',
    'renderer/vulkan/BufferVk.cpp',
    'renderer/vulkan/CompilerVk.cpp',
    'renderer/vulkan/ContextVk.cpp',
    'renderer/vulkan/DeviceVk.cpp',
    'renderer/vulkan/DisplayVk.cpp',
    'renderer/vulkan/FenceNVVk.cpp',
    'renderer/vulkan/FenceSyncVk.cpp',
    'renderer/vulkan/FramebufferVk.cpp',
    'renderer/vulkan/ImageVk.cpp',
    'renderer/vulkan/ProgramVk.cpp',
    'renderer/vulkan/QueryVk.cpp',
    'renderer/vulkan/RenderbufferVk.cpp',
    'renderer/vulkan/RendererVk.cpp',
    'renderer/vulkan/SamplerVk.cpp',
    'renderer/vulkan/ShaderVk.cpp',
    'renderer/vulkan/SurfaceVk.cpp',
    'renderer/vulkan/TextureVk.cpp',
    'renderer/vulkan/TransformFeedbackVk.cpp',
    'renderer/vulkan/VertexArrayVk.cpp',
    'ResourceManager.cpp',
    'Sampler.cpp',
    'Shader.cpp',
    'signal_utils.cpp',
    'State.cpp',
    'Stream.cpp',
    'Surface.cpp',
    'Texture.cpp',
    'TransformFeedback.cpp',
    'Uniform.cpp',
    'validationEGL.cpp',
    'validationES.cpp',
    'validationES2.cpp',
    'validationES3.cpp',
    'validationES31.cpp',
    'VertexArray.cpp',
    'VertexAttribute.cpp',
]
SOURCES += [
    '../compiler/translator/EmulateGLFragColorBroadcast.cpp',
    '../compiler/translator/glslang_lex.cpp',
    '../compiler/translator/glslang_tab.cpp',
    'Display.cpp',
    'renderer/d3d/DisplayD3D.cpp',
    'renderer/d3d/HLSLCompiler.cpp',
]
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    UNIFIED_SOURCES += [
        'renderer/d3d/d3d11/Blit11.cpp',
        'renderer/d3d/d3d11/Buffer11.cpp',
        'renderer/d3d/d3d11/Clear11.cpp',
        'renderer/d3d/d3d11/Context11.cpp',
        'renderer/d3d/d3d11/DebugAnnotator11.cpp',
        'renderer/d3d/d3d11/dxgi_support_table.cpp',
        'renderer/d3d/d3d11/Fence11.cpp',
        'renderer/d3d/d3d11/formatutils11.cpp',
        'renderer/d3d/d3d11/Framebuffer11.cpp',
        'renderer/d3d/d3d11/Image11.cpp',
        'renderer/d3d/d3d11/IndexBuffer11.cpp',
        'renderer/d3d/d3d11/InputLayoutCache.cpp',
        'renderer/d3d/d3d11/PixelTransfer11.cpp',
        'renderer/d3d/d3d11/Query11.cpp',
        'renderer/d3d/d3d11/Renderer11.cpp',
        'renderer/d3d/d3d11/renderer11_utils.cpp',
        'renderer/d3d/d3d11/RenderStateCache.cpp',
        'renderer/d3d/d3d11/RenderTarget11.cpp',
        'renderer/d3d/d3d11/ShaderExecutable11.cpp',
        'renderer/d3d/d3d11/StateManager11.cpp',
        'renderer/d3d/d3d11/StreamProducerNV12.cpp',
        'renderer/d3d/d3d11/texture_format_table.cpp',
        'renderer/d3d/d3d11/texture_format_table_autogen.cpp',
        'renderer/d3d/d3d11/TextureStorage11.cpp',
        'renderer/d3d/d3d11/TransformFeedback11.cpp',
        'renderer/d3d/d3d11/Trim11.cpp',
        'renderer/d3d/d3d11/VertexArray11.cpp',
        'renderer/d3d/d3d11/VertexBuffer11.cpp',
    ]
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    SOURCES += [
        'renderer/d3d/d3d11/SwapChain11.cpp',
        'renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp',
    ]


if CONFIG['GNU_CXX']:
    CXXFLAGS += [
        '-Wno-attributes',
        '-Wno-shadow',
        '-Wno-sign-compare',
        '-Wno-unknown-pragmas',
        '-Wno-unreachable-code',
    ]
    if CONFIG['CLANG_CXX']:
        CXXFLAGS += [
            '-Wno-inconsistent-missing-override',
            '-Wno-unused-private-field',
        ]
    else:
        CXXFLAGS += [
            '-Wno-shadow-compatible-local',
            '-Wno-shadow-local',
        ]

if CONFIG['MOZ_DIRECTX_SDK_PATH'] and not CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    LOCAL_INCLUDES += ['%' + '%s/include/' % CONFIG['MOZ_DIRECTX_SDK_PATH']]

DEFINES['_CRT_SECURE_NO_DEPRECATE'] = True
DEFINES['_HAS_EXCEPTIONS'] = 0

if not CONFIG['MOZ_DEBUG']:
    DEFINES['_SECURE_SCL'] = 0

DEFINES['ANGLE_ENABLE_D3D9'] = True
DEFINES['ANGLE_SKIP_DXGI_1_2_CHECK'] = True
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    DEFINES['ANGLE_ENABLE_D3D11'] = True

DEFINES['ANGLE_COMPILE_OPTIMIZATION_LEVEL'] = 'D3DCOMPILE_OPTIMIZATION_LEVEL1'
DEFINES['ANGLE_NO_EXCEPTIONS'] = True

# We need these defined to nothing so that we don't get bogus dllimport declspecs
DEFINES['GL_APICALL'] = ""
DEFINES['GL_GLEXT_PROTOTYPES'] = ""
DEFINES['EGLAPI'] = ""



LOCAL_INCLUDES += [ '../../include', '../../src', '../../src/common/third_party/numerics', '../../src/third_party/khronos' ]

DEFINES['LIBANGLE_IMPLEMENTATION'] = "1"
DEFINES['ANGLE_ENABLE_HLSL'] = "1"
DEFINES['ANGLE_ENABLE_GLSL'] = "1"
DEFINES['ANGLE_ENABLE_ESSL'] = "1"
DEFINES['ANGLE_ENABLE_KEYEDMUTEX'] = "1"
DEFINES['ANGLE_DEFAULT_D3D11'] = "0"

if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
  OS_LIBS += [ 'd3d9', 'dxguid' ]
else:
  EXTRA_DSO_LDOPTS += [
    '\'%s/lib/%s/d3d9.lib\'' % (CONFIG['MOZ_DIRECTX_SDK_PATH'], CONFIG['MOZ_D3D_CPU_SUFFIX']),
    '\'%s/lib/%s/dxguid.lib\'' % (CONFIG['MOZ_DIRECTX_SDK_PATH'], CONFIG['MOZ_D3D_CPU_SUFFIX']),
  ]

Library('libANGLE')


SOURCES['renderer/d3d/HLSLCompiler.cpp'].flags += ['-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES=\'{ TEXT("d3dcompiler_47.dll"), TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }\'']

if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    SOURCES['renderer/d3d/d3d11/SwapChain11.cpp'].flags += ['-DANGLE_RESOURCE_SHARE_TYPE=D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX']

# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True

